﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Maticsoft.DBUtility;
public partial class WebBusiness_Page_BusinessRegist : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //MsgBox("注册成功!", "../index.aspx");
        string action = Request.Form["action"];
        if (action == "regist")
        {
            Regist();
        }
    }
    private void Regist()
    {
        string userName = Request.Form["userName"];
        string passWord = Request.Form["password1"];
        string userPhone = Request.Form["userPhone"];
        string industry = Request.Form["industry"];
        string email = Request.Form["email"];
        string sql = string.Format("insert  into TB_UserInfo(userName,userPassword,phone,email,industryID) values({0},{1},{2},{3},{4})",
            AddQuotes(userName), AddQuotes(passWord), AddQuotes(userPhone)
            , AddQuotes(email),industry);
        int count = DbHelperOleDb.ExecuteSql(sql);
        if (count > 0)
        {
            Response.Write("<script>alert('注册成功!');window.location.href ='../index.aspx'</script>"); 
        }
    }
    private string AddQuotes(string str)
    {
        return "'" + str + "'";
    }
}